module game {
	/**
	 * app根节点
	 * @author caizj
	 *
	 */
	export class AppRoot extends egret.DisplayObjectContainer{
        
        private scrollView: SwiperScrollView;//滑动容器
        private arrowTip: egret.MovieClip;//下滑箭头
        
		public constructor() {
            super();
            this.addEventListener(egret.Event.ADDED_TO_STAGE,this.onAddToStage,this);
		}
        
        private onAddToStage(event: egret.Event) {
            this.removeEventListener(egret.Event.ADDED_TO_STAGE,this.onAddToStage,this);
            
            this.initUI();
        }
        
        
        private initUI(): void { 
            //设置滑动区域，默认为满屏大小
            this.scrollView = new SwiperScrollView();
            this.addChild(this.scrollView);
            
            //下滑箭头，默认在底部中央
            var json: any = RES.getRes("arrow_next_json");
            var texture: any = RES.getRes("arrow_next_png");
            this.arrowTip = new egret.MovieClip(new egret.MovieClipDataFactory(json, texture).generateMovieClipData("normal"));
            this.arrowTip.x = (AppConfig.WIDTH - this.arrowTip.width) / 2;
            this.arrowTip.y = AppConfig.HEIGHT - this.arrowTip.height;
            this.addChild(this.arrowTip);
            this.arrowTip.play(-1);
            
            //一闪一亮[循环]
            egret.Tween.get(this.arrowTip,{ loop: true }).to({ alpha: 0 },500).to({alpha:1},500);
        }
	}
}
